# src/SConscript begin

Import("env")

# Libraries used:
libs = []

# Core object files:
obj_exception = env.Object("util/exception.cpp")
obj_mem = env.Object("util/mem.cpp")
obj_hash = env.Object("util/hash.cpp")
obj_utf8 = env.Object("util/utf8.cpp")
core_objs = [obj_exception, obj_mem, obj_hash, obj_utf8]

# ADT object files:
obj_string = env.Object("adts/string.cpp")
adt_objs = [obj_string]

# Standard library files:
obj_nfa = env.Object("util/nfa.cpp")
obj_re = env.Object("util/re.cpp")
lib_objs = [obj_nfa, obj_re]

# All objects
objs = core_objs + adt_objs + lib_objs

# Build tests:
def ripe_test(env, objs, libs, test_name):
    obj_test = env.Object("test/" + test_name + ".cpp")
    env.Program(target = "test/" + test_name,
                source = objs + obj_test,
                LIBS = libs)

ripe_test(env, objs, libs, "adts_test")
ripe_test(env, objs, libs, "re_test")

# src/SConscript end
